//
//  TableViewCell.m
//  adaptive
//
//  Created by xingshuai on 2021/2/20.
//

#import "TableViewCell.h"

#import <Masonry.h>

@interface TableViewCell ()

@property (nonatomic, strong) UILabel *label;
@property (nonatomic, strong) UILabel *botLabel;

@end

@implementation TableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.label = [[UILabel alloc]init];
        self.label.textColor = UIColor.orangeColor;
        self.label.numberOfLines = 0;
        self.label.font = [UIFont systemFontOfSize:20];
        [self.contentView addSubview:self.label];
        [self.label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.top.equalTo(self.contentView).offset(15);
            make.right.equalTo(self.contentView).offset(-15);
        }];
        
        self.botLabel = [[UILabel alloc]init];
        self.botLabel.textColor = UIColor.redColor;
        self.botLabel.numberOfLines = 0;
        self.botLabel.font = [UIFont systemFontOfSize:20];
        [self.contentView addSubview:self.botLabel];
        [self.botLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.label.mas_bottom).offset(10);
            make.left.equalTo(self.contentView).offset(15);
            make.right.bottom.equalTo(self.contentView).offset(-15);
        }];
    }
    return self;
}

-(void)setStr:(NSString *)str {
    _str = str;
    self.label.text = str;
    self.botLabel.text = str;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
